import { getUserInfo, login, loadMenu } from "./user";
function ResultData<T>(data:T, status = 200) {
  return {
    status,
    data: data || {},
    msg: "success",
  };
}

/**
 * 
 * @param param0 
 * @param type 
 * @returns 
 */
export function mock({ url = "", data = null, config = null }, type = "get") {
  if (url.includes("user/all") && type === "get") {
    return ResultData(getUserInfo());
  }
  if (url.includes("/login") && type === "post") {
    return ResultData(login());
  }
  if (url.includes("/menu") && type === "get") {
    return ResultData(loadMenu());
  }
}
